package server;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;

import javax.swing.JPanel;

public class VSM_DataDisplay extends JPanel
{
	private static final long serialVersionUID = -5086501488102741118L;
	private final String sensorID;
	private final String dataUnit;
	
	private final double bottomValue;
	private final double topValue;
	
	private final long timeOut;
	
	private double currentValue;
	
	VSM_DataDisplay(String sensorID, String dataUnit, double bottomValue, double topValue, long timeOut)
	{
		this.sensorID = sensorID;
		this.dataUnit = dataUnit;
		
		this.bottomValue = bottomValue;
		this.topValue = topValue;
		
		this.timeOut = timeOut;
	}
	
	@Override
	public void paint(Graphics g)
	{
		Graphics2D g2d = (Graphics2D)g;

        Dimension size = getSize();
        Insets insets = getInsets();
        
        int largRec;
        int largura;
        int altura;
        
        this.setBackground(Color.black);
        
        largura = size.width - insets.left - insets.right;
        System.out.println(largura);
        altura = size.height - insets.top - insets.bottom;
        
        
        
        for (int i = 0; i < largura; i++)
        {
        	if(i%10 == 0)
        	{
        		g2d.drawLine(i, 0, i, 10);
        	}
        }
	}
	
	double getCurrentValue()
	{
		return currentValue;
	}
	
	void setCurrentValue(double currentValue)
	{
		this.currentValue = currentValue;
	}
	
	static long getSerialversionuid()
	{
		return serialVersionUID;
	}
	
	String getSensorID()
	{
		return sensorID;
	}
	
	String getDataUnit()
	{
		return dataUnit;
	}
	
	double getBottomValue()
	{
		return bottomValue;
	}
	
	double getTopValue()
	{
		return topValue;
	}
	
	long getTimeOut()
	{
		return timeOut;
	}
}
